#ifndef SERIAL
#define SERIAL
#include <windows.h>
#include <string>

#define MAX_NR_BYTES 64

using namespace std;

class Serial{

private:
    HANDLE handle;
    BYTE byte[MAX_NR_BYTES];
    DWORD nrBytes;
    COMMTIMEOUTS timeout;
    DCB dcb;
public:
    Serial();
    char * receive(int length);
    int send(char *command, int bytes);
    int connect(CString port);
    int connect(CString port, int set_timeout, int bytesize, int baudrate, int parity);
    int disconnect();
    int flush();
};
#endif
